package com.heheda.www.web;

import com.heheda.www.model.User;
import com.heheda.www.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description:
 *
 * @date:2021/10/28 16:05
 * @author:呵呵哒
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @Autowired
    private UserService userService2;

    @RequestMapping(value = "/userDetail")
    public String userDetail(Model model, Integer id){
        User user = userService.queryUserById(id);
        model.addAttribute("user",user);

        User user2 = userService2.queryUserById(id);
        model.addAttribute("user2",user2);

        return "userDetail";
    }

}
